// 导入 jsrsasign 库
import * as smCry from 'sm-crypto';

export default class CryptoUtils {
  // SM4 加密
  static sm4Encrypt(plaintext: string, key: string): string {
    const encrypted = smCry.sm4.encrypt(plaintext, key);
	return encrypted;
  }

  // SM4 解密
  static sm4Decrypt(ciphertext: string, key: string): string {
    const decrypted = smCry.sm4.decrypt(ciphertext, key);
    return decrypted;
  }
  static getKey(){
	  return "789abcdef01234560123456789abcdef";
  }
}